<!--制度审批操作通用界面-->
<div class="OutDiv">
  <div class="addPage">
    <div class="backDiv">
      <span>{{currType == 2?'详情':'审批意见'}}</span>
      <span class="fl-r operaFont" (click)="back(false)">
        返回上一级<i class="fa fa-reply m-l-sm"></i>
      </span>
    </div>
    <div class="formdiv">
      <div nz-row>
        <div nz-col nzSpan="12">
          <nz-form-item>
            <nz-form-label [nzSm]="4">
              文件号
            </nz-form-label>
            <nz-form-control [nzSm]="20" [nzXs]="12">
              {{materialObj?.number}}
            </nz-form-control>
          </nz-form-item>
        </div>
        <div nz-col nzSpan="12">
          <nz-form-item>
            <nz-form-label [nzSm]="4">
              制度名称
            </nz-form-label>
            <nz-form-control [nzSm]="20" [nzXs]="12">
              {{materialObj?.name}}
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>
      <div nz-row>
        <div nz-col nzSpan="12">
          <nz-form-item>
            <nz-form-label [nzSm]="4">
              制度类型
            </nz-form-label>
            <nz-form-control [nzSm]="20" [nzXs]="12">
              {{materialObj?.caseType}}
            </nz-form-control>
          </nz-form-item>
        </div>
        <div nz-col nzSpan="12">
          <nz-form-item>
            <nz-form-label [nzSm]="4">
              执行部门
            </nz-form-label>
            <nz-form-control [nzSm]="20" [nzXs]="12">
              {{materialObj?.deptNameStr}}
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>
      <div nz-row>
        <div nz-col nzSpan="12">
          <nz-form-item>
            <nz-form-label [nzSm]="4">
              作用对象
            </nz-form-label>
            <nz-form-control [nzSm]="20" [nzXs]="12">
              {{materialObj?.actionTarget}}
            </nz-form-control>
          </nz-form-item>
        </div>
        <div nz-col nzSpan="12">
          <nz-form-item>
            <nz-form-label [nzSm]="4">
              制度状态
            </nz-form-label>
            <nz-form-control [nzSm]="20" [nzXs]="12">
              {{stateObj[materialObj?.state]}}
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>
      <div nz-row>
        <div nz-col nzSpan="12">
          <nz-form-item>
            <nz-form-label [nzSm]="4">
              制度生效日期
            </nz-form-label>
            <nz-form-control [nzSm]="20" [nzXs]="12">
              {{materialObj?.effectiveDate | date: 'yyyy-MM-dd'}}
            </nz-form-control>
          </nz-form-item>
        </div>
        <div nz-col nzSpan="12">
          <nz-form-item>
            <nz-form-label [nzSm]="4">
              查看有效日期
            </nz-form-label>
            <nz-form-control [nzSm]="20" [nzXs]="12">
              <span *ngIf="materialObj?.noLimitViewDate">不限</span>
              <span *ngIf="!materialObj?.noLimitViewDate">
                  {{materialObj?.viewStartDate | date: 'yyyy-MM-dd'}}至{{materialObj?.viewEndDate | date: 'yyyy-MM-dd'}}
                </span>
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>
      <div nz-row>
        <div nz-col nzSpan="12">
          <nz-form-item>
            <nz-form-label [nzSm]="4">
              发布人
            </nz-form-label>
            <nz-form-control [nzSm]="20" [nzXs]="12">
              {{materialObj?.publisherName}}
            </nz-form-control>
          </nz-form-item>
        </div>
        <div nz-col nzSpan="12">
          <nz-form-item>
            <nz-form-label [nzSm]="4">
              发布部门
            </nz-form-label>
            <nz-form-control [nzSm]="20" [nzXs]="12">
              {{materialObj?.publishDeptName}}
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>
      <div nz-row>
        <div nz-col nzSpan="12">
          <nz-form-item>
            <nz-form-label [nzSm]="4">
              发布日期
            </nz-form-label>
            <nz-form-control [nzSm]="20" [nzXs]="12">
              {{materialObj?.publishDate}}
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>
      <div nz-row>
        <div nz-col nzSpan="24">
          <nz-form-item>
            <nz-form-label [nzSm]="2">
              附件
            </nz-form-label>
            <nz-form-control [nzSm]="20" [nzXs]="12">
              <div *ngIf="!materialObj?.source">—</div>
              <div class="pdfBox" *ngIf="materialObj?.source">
                <ng2-pdfjs-viewer [pdfSrc]="materialObj?.source"
                                  [print] = "false"
                                  #pdfViewer
                                  [page]="1"
                                  [download] = "false"
                                  [fullScreen] = "false"
                                  [openFile] = "false"
                                  [viewBookmark] = "false"
                                  [viewerId]="materialObj?.sourceList[0].id"
                                  (onDocumentLoad)="pdfLoad($event)"
                ></ng2-pdfjs-viewer>
              </div>
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>

      <div class="opreatdiv" *ngIf="pageType == 2" style="width: 100%">
        <div class="opreatdiv_row">
          <label class="titlelabel">执行反馈情况</label>
        </div>
        <div nz-row>
          <div nz-col nzSpan="12">
            <nz-form-item>
              <nz-form-label [nzSm]="4">
                反馈人
              </nz-form-label>
              <nz-form-control [nzSm]="20" [nzXs]="12">
                {{materialObj?.feedbackUserName}}
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col nzSpan="12">
            <nz-form-item>
              <nz-form-label [nzSm]="4">
                反馈时间
              </nz-form-label>
              <nz-form-control [nzSm]="20" [nzXs]="12">
                {{materialObj?.feedbackDate}}
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row>
          <div nz-col nzSpan="12">
            <nz-form-item>
              <nz-form-label [nzSm]="4">
                是否执行
              </nz-form-label>
              <nz-form-control [nzSm]="20" [nzXs]="12">
                {{materialObj?.isExecute == 1?'是':'否'}}
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col nzSpan="12">
            <nz-form-item>
              <nz-form-label [nzSm]="4">
                {{materialObj?.isExecute == 1?'执行情况记录':'备注原因'}}
              </nz-form-label>
              <nz-form-control [nzSm]="20" [nzXs]="12">
                {{materialObj?.content}}
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
      </div>

      <div class="opreatdiv" *ngIf="pageType == 2 && currType == 2" style="width: 100%">
        <div class="opreatdiv_row">
          <label class="titlelabel">审批意见</label>
        </div>
        <div nz-row>
          <div nz-col nzSpan="12">
            <nz-form-item>
              <nz-form-label [nzSm]="4">
                审批人
              </nz-form-label>
              <nz-form-control [nzSm]="20" [nzXs]="12">
                {{materialObj?.checkerName}}
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col nzSpan="12">
            <nz-form-item>
              <nz-form-label [nzSm]="4">
                审批状态
              </nz-form-label>
              <nz-form-control [nzSm]="20" [nzXs]="12">
                {{materialObj?.feedbackState == 10 ?'已反馈':(materialObj?.feedbackState == 15?'未通过':'')}}
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row *ngIf="pageType == 2 && currType == 2 && materialObj?.feedbackState == 15">
          <div nz-col nzSpan="24">
            <nz-form-item>
              <nz-form-label [nzSm]="2">
                驳回理由
              </nz-form-label>
              <nz-form-control [nzSm]="20" [nzXs]="12">
                {{materialObj?.checkContent}}
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
      </div>

      <!--详情查看-->
      <div nz-row *ngIf="pageType == 1 && currType == 2">
        <div nz-col nzSpan="12">
          <nz-form-item>
            <nz-form-label [nzSm]="4">
              审批人
            </nz-form-label>
            <nz-form-control [nzSm]="20" [nzXs]="12">
              {{materialObj?.checkerName}}
            </nz-form-control>
          </nz-form-item>
        </div>
        <div nz-col nzSpan="12">
          <nz-form-item>
            <nz-form-label [nzSm]="4">
              审批状态
            </nz-form-label>
            <nz-form-control [nzSm]="20" [nzXs]="12">
              {{materialObj?.publishState == 10 ?'已发布':(materialObj?.publishState == 15?'未通过':'')}}
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>
      <div nz-row *ngIf="pageType == 1 && currType == 2 && materialObj?.publishState == 15">
        <div nz-col nzSpan="24">
          <nz-form-item>
            <nz-form-label [nzSm]="2">
              驳回理由
            </nz-form-label>
            <nz-form-control [nzSm]="20" [nzXs]="12">
              {{materialObj?.content}}
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>
    </div>


    <div class="opreatdiv" *ngIf="currType != 2">
      <div class="opreatdiv_row">
        <label class="titlelabel"><span style="color: red">*</span>审批意见</label>
        <span class="titlespan">
          <nz-radio-group [(ngModel)]="currType" (ngModelChange)="approvalChange($event)">
            <label nz-radio [nzValue]="1">通过</label>
            <label nz-radio [nzValue]="0">驳回</label>
          </nz-radio-group>
        </span>
      </div>
      <div class="opreatdiv_row" [hidden]="currType != 1">
        <div class="passdiv">您确定要通过该项制度并发布？</div>
      </div>
      <div class="opreatdiv_row" [hidden]="currType != 0">
        <div class="nopassdiv">
          <label><span style="color: red">*</span>请输入理由：</label>
          <textarea nz-input [(ngModel)]="remark" placeholder="请输入" rows="5" maxlength="200" style="resize: none;vertical-align: top;width: 80%;font-size: 16px"></textarea>
        </div>
      </div>
      <div class="opreatdiv_row">
        <div class="buttondiv">
          <button nz-button nzType="default" (click)="back(false)">取消</button>
          <button class="m-l-lm" nz-button nzType="primary" (click)="auditClick()">确定</button>
        </div>
      </div>
    </div>


  </div>
</div>
